<%--
  Created by IntelliJ IDEA.
  User: lanmeng
  Date: 2020/8/31
  Time: 19:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/toastr/toastr.min.css"/>
<script src="${pageContext.request.contextPath}/static/js/jquery-2.1.0.js" type="text/javascript"
        charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/static/toastr/toastr.min.js" type="text/javascript"
        charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js" type="text/javascript"
        charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/warehouse/js/goodsStock.js" type="text/javascript"
        charset="utf-8"></script>
<html>
<head>
    <title>物品库存</title>
</head>
<style>
    .table>tbody>tr>td {
        vertical-align: middle;
    }

    th{
        text-align: center;
    }

</style>
<body>
<div>
    <h3 class="text-center">物品库存信息</h3>
    <div style="padding:20px;">
        <form role="form" class="form-inline">
            <div class="form-group">
                <label>商品名称</label>
                <select class="form-control" id="goodsName">
                    <option value="">商品名称</option>
                </select>
            </div>
            <div class="form-group">
                <label>商品类型</label>
                <select class="form-control" id="categoryName">
                    <option value="">商品类型</option>
                </select>
            </div>
            <button type="button" class="btn btn-primary btn-sm" onclick="page(1,5)">搜索</button>
            <input type="button" class="btn btn-primary btn-sm" onclick="purchase()" value="采购" data-toggle="modal" data-target="#myModal">
            <input type="button" class="btn btn-danger btn-sm"  onclick="detailsPage(1,5)" value="采购单详情" data-toggle="modal" data-target="#myModal1">
        </form>
    </div>
    <div>
        <table class="table table-hover table-bordered" style="text-align: center">
            <thead>
                <tr style="background-color: #BBDCFB" >
                    <th><input type='checkbox' id="host" ></th>
                    <th>商品编号</th>
                    <th>商品名称</th>
                    <th>供货商</th>
                    <th>售价</th>
                    <th>进价</th>
                    <th>类型</th>
                    <th>数量</th>
                    <th>状态</th>
                </tr>
            </thead>
            <tbody id="tb"></tbody>
        </table>
    </div>
    <div class="form-inline">
                <span id="navBar">显示第<span id="start">0</span>到<span id="end"></span>条，总共<span id="count"></span>页记录，每页显示
                    <div class="btn-group dropup">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span id="pageCount"></span>&nbsp;&nbsp;<span class="caret"></span></button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="javascript:page(1,5)">5</a></li>
                    <li><a href="javascript:page(1,10)">10</a></li>
                    <li><a href="javascript:page(1,50)">50</a></li>
                    <li><a href="javascript:page(1,100)">100</a></li>
                </ul>
            </div>
                    条记录</span>
        <div class="btn-group pull-right">
            <nav  aria-label="Page navigation" >
                <ul class="pagination" id="page" style="margin: 0px 0">
                </ul>
            </nav>
        </div>
    </div>
    <%--    模态框 采购  --%>
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">采购订单</h4>
                </div>
                <div class="modal-body">
                    <table class="table table-hover table-bordered" style="text-align: center">
                        <thead>
                        <tr style="background-color: #BBDCFB" >
                            <th>商品编号</th>
                            <th>商品名称</th>
                            <th>供货商</th>
                            <th>进价</th>
                            <th>数量</th>
                        </tr>
                        </thead>
                        <tbody id="tb1"></tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-md-6 " >
                        <div class="input-group">
                            <span class="input-group-addon">处理人ID</span>
                            <input  data-rule='max:10:min:2' class="form-control" placeholder="处理人ID" value="${staff.staffId}" id="staffId" disabled >
                        </div>
                    </div>
                    <div class="col-md-6" >
                        <div class="input-group">
                        <span class="input-group-addon">处理人</span>
                            <input  data-rule='max:10:min:2' class="form-control" placeholder="处理人" value="${staff.staffName}" disabled>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 " >
                        <div class="input-group">
                            <span class="input-group-addon">订单号</span>
                            <input  data-rule='max:10:min:2' class="form-control" placeholder="订单号" id="storageId" disabled >
                        </div>
                    </div>
                    <div class="col-md-6" >
                        <div class="input-group">
                            <span class="input-group-addon">总价格</span>
                            <input  data-rule='max:10:min:2' class="form-control" placeholder="总价格" id="countPrice" disabled>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="purchaseSubmit()">确认</button>
                </div>
            </div>
        </div>
    </div>
    <%--    模态框 采购 --%>
    <%--    模态框 采购单 --%>
    <div class="modal fade bs-example-modal-lg" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel1">采购单详情</h4>
                </div>
                <div class="modal-body">
                    <div>
                        <table class="table table-hover table-bordered" style="text-align: center">
                            <thead>
                            <tr style="background-color: #BBDCFB" >
                                <th>采购单号</th>
                                <th>经办人</th>
                                <th>下单时间</th>
                                <th>总价</th>
                                <th>状态</th>
                                <th>备注</th>
                            </tr>
                            </thead>
                            <tbody id="tb2"></tbody>
                        </table>
                    </div>
                    <div class="form-inline">
                        <span id="navBar1">显示第<span id="start1">0</span>到<span id="end1"></span>条，总共<span id="count1"></span>页记录，每页显示
                            <div class="btn-group dropup">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span id="pageCount1"></span>&nbsp;&nbsp;<span class="caret"></span></button>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="javascript:detailsPage(1,5)">5</a></li>
                                    <li><a href="javascript:detailsPage(1,10)">10</a></li>
                                    <li><a href="javascript:detailsPage(1,50)">50</a></li>
                                    <li><a href="javascript:detailsPage(1,100)">100</a></li>
                                </ul>
                            </div>
                        条记录</span>
                        <div class="btn-group pull-right">
                            <nav  aria-label="Page navigation" >
                                <ul class="pagination" id="page1" style="margin: 0px 0">
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <%--    模态框 采购单 --%>
</div>
<script>
    /**
     * 数量验证
     */
    // $(function () {
    //     $(".code").bind('input porpertychange', function () {
    //         if(parseFloat($(this).val())>=50){
    //             f=1;
    //         }else {
    //             toastr.error("采购数量最少50");
    //             f=-1;
    //         }
    //     })
    // })


</script>
</body>
</html>
